<template>
<!-- 该界面给推荐和最新专辑两个复用 -->
<div class="personalized">
  <div class="personalized-top">
    <h3>{{title}}</h3>
  </div>
  <div class="personalized-list">
    <div v-for="value in personalized" :key="value.id">
      <div class="item" @click="selectItem(value.id)">
        <img v-lazy="value.picUrl" alt="">
        <p>{{value.name}}</p>
      </div>
    </div>
  </div>
</div>

</template>

<script>
export default {
  name:"Personalized",
  props:{
    personalized:{
      type:Array,
      default:()=>[],
      requieted:true
    },
    title:{
      type:String,
      default:'',
      required:true
    },
    title:{
      type:String,
      default:'',
      required:true
    },
    type:{
      type:String,
      default:'',
      required:true
    }
  },
  methods:{
    //调用父组件方法传递参数 实现跳转到对应歌单
    selectItem(id){
      this.$emit('select',id,this.type)
    }
  }
}
</script>

<style lang="scss" scoped>
@import "../../assets/css/mixin";
@import "../../assets/css/variable";
.personalized{
  @include bg_sub_color();
  .personalized-top{
    width:100%;
    height: 84px;
    line-height: 84px;
    padding: 0px 20px;
    border-bottom: 1px solid #ccc;
    @include bg_sub_color();
    h3{
      font-weight: bold;
      @include font_size($font_large);
      @include font_color();
    }
  }
  .personalized-list{
    width: 100%;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    padding: 20px 0;
    .item{
      width: 200px;
      padding-bottom: 20px;
      img{
        width: 200px;
        height: 200px;
        border-radius: 20px;
      }
    }
    p{
      @include clamp(2);
      @include font_size($font_medium_s);
      @include font_color();
      text-align: center;
    }
  }
}
</style>